package de.carcophan.jimdb.gwt.client.events;

import com.google.gwt.event.shared.GwtEvent;

import de.carcophan.jimdb.gwt.shared.entites.Movie;

public class MovieSelectedEvent extends GwtEvent<MovieSelectedEventHandler> {

   public static final Type<MovieSelectedEventHandler> TYPE = new Type<MovieSelectedEventHandler>();
   private Movie selectedMovie;

   public MovieSelectedEvent(Movie selectedMovie) {
      this.selectedMovie = selectedMovie;
   }

   @Override
   protected void dispatch(MovieSelectedEventHandler handler) {
      handler.onSelect(this);
   }

   @Override
   public com.google.gwt.event.shared.GwtEvent.Type<MovieSelectedEventHandler> getAssociatedType() {
      return TYPE;
   }

   public Movie getSelectedMovie() {
      return selectedMovie;
   }

}
